<?php

class Group extends Zend_Db_Table
{
    protected $_name = 'studygroup';
    
    public function getGroup($id)
    {
        $group = $this->fetchRow('id='.$id);
        return $group;
    }
    
    public function getGroupName($id)
    {
        $group = $this->fetchRow('id='.$id);
        return $group->name;
    }
    
    public function getNames(){
       $groups = $this->fetchAll(); 
       $return = array();
       foreach($groups as $gr) {
           $return[$gr->id] = $gr->name;
       }
       return $return;
    }
    
}
